home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Networking / MacTCP / MacTCP Developer Tools / 802 LAP / MiscIPPB.h < prev   
Encoding:
C/C++ Source or Header  |  1993-06-15  |  2.5 KB  |  101 lines  |  [TEXT/MPS ]

  1. /* 
  2.     IPPB.h    
  3.     C definitions of parameter block entries needed for IP calls
  4.  
  5.     Copyright Apple Computer, Inc. 1988 
  6.     All rights reserved
  7.     
  8. */
  9.  
  10. /* control codes */
  11. #define ipctlEchoICMP        17            /* send icmp echo */
  12. #define ipctlLAPStats        19            /* get lap stats */
  13.  
  14. #define icmpEchoTimeoutErr         -23035            /* ICMP echo timed-out */
  15.  
  16. #define ParamBlockHeader     \
  17.     struct QElem *qLink;     \
  18.     short qType;             \
  19.     short ioTrap;             \
  20.     Ptr ioCmdAddr;             \
  21.     ProcPtr ioCompletion;     \
  22.     OSErr ioResult;         \
  23.     StringPtr ioNamePtr;     \
  24.     short ioVRefNum;        \
  25.     short ioCRefNum;        \
  26.     short csCode
  27.     
  28. typedef pascal void (*ICMPEchoNotifyProc) (struct ICMPParamBlock *iopb);
  29.  
  30.  
  31. struct IPParamBlock {
  32.     ParamBlockHeader;                    /* standard I/O header */
  33.     union {
  34.         struct {
  35.             ip_addr    dest;                /* echo to IP address */
  36.             wdsEntry data;
  37.             short timeout;
  38.             ICMPEchoNotifyProc icmpCompletion;
  39.             } IPEchoPB;
  40.         struct {
  41.             struct LAPStats *lapStatsPtr;
  42.             } LAPStatsPB;
  43.         } csParam;
  44.     };
  45.  
  46. struct ICMPParamBlock {
  47.     ParamBlockHeader;                    /* standard I/O header */
  48.     short params[11];
  49.     struct {
  50.         unsigned long echoRequestOut;    /* time in ticks of when the echo request went out */
  51.         unsigned long echoReplyIn;        /* time in ticks of when the reply was received */
  52.         struct rdsEntry echoedData;        /* data received in responce */
  53.         } icmpEchoInfo;
  54.     };
  55.  
  56. typedef struct LAPStats {
  57.     short    ifType;
  58.     char    *ifString;
  59.     short    ifMaxMTU;
  60.     long    ifSpeed;
  61.     short    ifPhyAddrLength;
  62.     char    *ifPhysicalAddress;
  63.     union {
  64.         struct arp_entry *arp_table;    
  65.         struct nbp_entry *nbp_table;
  66.         } AddrXlation;
  67.     short    slotNumber;
  68.     };
  69.     
  70. #define NBP_TABLE_SIZE    20                /* number of NBP table entries */
  71. #define NBP_MAX_NAME_SIZE    16+10+2
  72.  
  73. struct nbp_entry {
  74.     ip_addr     ip_address;                /* IP address */
  75.     AddrBlock    at_address;                /* matching AppleTalk address */
  76.     Boolean        gateway;                /* TRUE if entry for a gateway */
  77.     Boolean        valid;                    /* TRUE if LAP address is valid */
  78.     Boolean        probing;                /* TRUE if NBP lookup pending */
  79.     int            age;                    /* ticks since cache entry verified */
  80.     int            access;                    /* ticks since last access */
  81.     char        filler[116];            /* for internal use only !!! */
  82.     };
  83.  
  84. #define ARP_TABLE_SIZE    20                /* number of ARP table entries */
  85.  
  86.  
  87. /*    Apr 25, 1991.    Rajesh - We have our definitions for arp_entry,
  88.     and Enet_addr is already defined in the the file LAP802.h
  89. */
  90. //    typedef struct Enet_addr {
  91. //        b_16 en_hi;
  92. //        b_32 en_lo;
  93. //        } Enet_addr;
  94.  
  95. //    typedef struct arp_entry {
  96. //        short        age;            /* cache aging field */
  97. //        b_16        protocol;        /* Protocol type */
  98. //        ip_addr     ip_address;        /* IP address */
  99. //        Enet_addr    en_address;        /* matching Ethernet address */
  100. //        };
  101.